import japa.parser.JavaParser;
import japa.parser.ast.CompilationUnit;

import java.io.File;
import java.io.FileInputStream;

import javax.swing.JFileChooser;
import javax.swing.JFrame;


public class Main {

public static void main(String[] args) throws Exception {
    	
    	final JFileChooser fc = new JFileChooser();

    	fc.showOpenDialog(new JFrame());
    	
        // creates an input stream for the file to be parsed
        File file = fc.getSelectedFile();
        System.out.println(file.getName());
        
        FileInputStream in = new FileInputStream(file.getAbsolutePath());
        
        
        
        CompilationUnit cu;
        try {
            // parse the file
            cu = JavaParser.parse(in);
            new CommentCounter(cu);
            new MethodPrinter(cu);
            new NumberOfLinesInClass(cu);
            new NumberOfLinesInMethods(cu);
            new LongParameterLists(cu);
        } finally {
            in.close();
        }
        }
}
